package com.ocom.oauth.client;

import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.dto.GetCompanyRoleListDto;
import com.ocom.common.resp.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(value = "company")
public interface CompanyClientService {

    /**
     * 获取管理员信息
     * @param userName
     * @return
     */
    @GetMapping(CompanyServiceUrl.URL_GetMngUserInfoByName)
    Result GetMngUserInfo(@RequestParam("userName")String userName);

    /**
     * 根据手机号获取管理员用户列表（/getMngUserInfoByPhone）
     * */
    @GetMapping(CompanyServiceUrl.URL_GetMngUserInfoByPhone)
    public Result GetMngUserInfoByPhone(@RequestParam("comId")Long comId,@RequestParam("phone")String phone);


    @PostMapping(CompanyServiceUrl.URL_getCompanyRole)
    public Result getCompanyRole(GetCompanyRoleListDto dto);

    @GetMapping(CompanyServiceUrl.URL_accountAndRole)
    Result getUserByNameAndRole(@RequestParam("account") String account, @RequestParam("role") String role);
}
